package com.example.chengma.dao.repostory.impl;

import com.example.chengma.dao.mapper.IChengmaMapper;
import com.example.chengma.dao.repostory.IcommentRepostory;
import com.example.chengma.pojo.vo.CommentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CommentRepostoryImpl implements IcommentRepostory {
    @Autowired
    IChengmaMapper chengmaMapper;
    public List<CommentVO> selectCommentVOByQuestionId(int qid){
        final List<CommentVO> ListcommentVOByQuestionId = chengmaMapper.getCommentVOByQuestionId(qid);
        return ListcommentVOByQuestionId;
    }

    @Override
    public Integer selectLikedCountByCommentId(int id) {
        Integer i = chengmaMapper.selectLikedCountByCommentId(id);
        return i;
    }

    @Override
    public Integer selectCollectedCountByCommentId(int id) {
        Integer i = chengmaMapper.selectCollectedCountByCommentId(id);
        return i;
    }
}
